Release 10.1A: OpenEdge Development:
Programming Interfaces
Adding and deleting records
To add records to a database, you can use either the
CREATEorINSERTstatements. TheCREATEstatement places a newly created record in the database, but does not display the record or request user input. All fields in the record are set to the initial values specified in the Data Dictionary. TheCREATEstatement causes anyCREATEtrigger associated with the table to execute. This trigger may set fields in the record to new values. TheINSERTstatement not only creates the record, but also displays the record and requests input.The
INSERTstatement is composed of four other statements—theCREATE,DISPLAY,PROMPT–FORandASSIGNstatements. Three of these statements (DISPLAY,PROMPT–FOR, andASSIGN) comprise theUPDATEstatement. You can emulate anINSERTstatement by using the four statements, or by using theCREATEandUPDATEstatements. This is more flexible than using theINSERTstatement alone.For example, the
INSERTstatement always displays fields in the order they are defined in the schema. TheUPDATEstatement lets you specify the order they are displayed. Note that if you use anINSERTstatement, theCREATEtrigger is executed before the record is displayed.To delete records from a database, use the
DELETEstatement. TheDELETEstatement causes anyDELETEtrigger associated with the table to execute. For more information on database triggers, see OpenEdge Development: Progress 4GL Handbook .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |